//
//  TKIMRoomDBProtocol.h
//  TKIM_标准版
//
//  Created by liupm on 16/3/14.
//  Copyright © 2016年 liupm. All rights reserved.
//

@protocol TKIMRoomDBProtocol <NSObject>

@optional

/**
 *  @Author lpm, 16-10-11 10:10:50
 *
 *  @brief  缓存一个房间对象
 *
 *  @param room 房间
 */
-(void)insertRoom:(TKIMRoom *)room;


/**
 *  @Author lpm, 16-10-11 10:10:36
 *
 *  @brief   缓存多个房间对象
 *
 *  @param rooms 房间数组
 */
-(void)insertRooms:(NSMutableArray *)rooms;


/**
 *  @Author lpm, 15-10-29 15:10:45
 *
 *  @brief  删除一个房间
 *
 *  @param room 房间
 */
-(void)removeRoom:(TKIMRoom *)room;


/**
 *  @Author lpm, 15-10-29 15:10:45
 *
 *  @brief  删除多个房间
 *
 *  @param rooms  房间数组
 */
-(void)removeRooms:(NSMutableArray *)rooms;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新一条房间信息
 *
 *  @param room   房间
 */
-(void)updateRoom:(TKIMRoom *)room;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新多条房间信息
 *
 *  @param rooms  房间数组
 */
-(void)updateRooms:(NSMutableArray *)rooms;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新群组消息接收状态
 *
 *  @param room 房间
 */
-(void)updateRoomIsAcceptPush:(TKIMRoom *)room;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新群组是否需要验证
 *
 *  @param room 房间
 */
-(void)updateGroupIsNeedVerify:(TKIMRoom *)room;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新群组是否禁言
 *
 *  @param room 房间
 */
-(void)updateGroupIsGag:(TKIMRoom *)room;


/**
 *  @Author lpm, 15-10-29 15:10:25
 *
 *  @brief  查询所有群和聊天室
 *
 */
-(NSMutableArray *)queryRooms;


/**
 *  @Author lpm, 16-10-11 10:10:55
 *
 *  @brief  查询一个房间
 *
 *  @param roomId 房间ID
 *  @param type   房间类型
 *
 *  @return 房间
 */
-(TKIMRoom *)queryARoom:(NSString *)roomId type:(NSInteger)type;


/**
 *  @Author lpm, 15-12-24 18:12:20
 *
 *  @brief  查询一个房间
 *
 *  @param roomId 房间ID
 *
 *  @return 房间
 */
-(TKIMRoom *)queryARoom:(NSString *)roomId;


/**
 *  @Author lpm, 15-12-24 18:12:20
 *
 *  @brief  查询某种房间结果集
 *
 *  @param type 房间类型
 *
 *  @return 房间数组
 */
-(NSMutableArray *)queryRoomsByType:(NSInteger)type;


/**
 *  @Author lpm, 16-10-11 10:10:56
 *
 *  @brief  查询是否加入某种房间结果集
 *
 *  @param type     房间类型
 *  @param isJoined 是否加入
 *
 *  @return
 */
-(NSMutableArray *)queryRoomsByType:(NSInteger)type isJoined:(BOOL)isJoined;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新群置顶状态
 *
 *  @param group 群
 */
-(void)setRoomIsToTop:(TKIMRoom *)group;


/**
 *  @Author lpm, 16-10-11 10:10:12
 *
 *  @brief  根据ID查询某种类型且是否加入的房间
 *
 *  @param roomId   房间ID
 *  @param type 类型
 *  @param isJoined 是否加入
 *
 *  @return 房间
 */
-(TKIMRoom *)queryARoom:(NSString *)roomId type:(NSInteger)type isJoined:(BOOL)isJoined;


/**
 *  @Author lpm, 16-10-11 10:10:47
 *
 *  @brief  根据关键字查询房间数组
 *
 *  @param key      关键字
 *  @param type     房间类型
 *  @param isJoined 是否加入了房间
 *
 *  @return 房间数组
 */
-(NSMutableArray *)queryRoomsByKey:(NSString *)key type:(NSInteger)type isJoined:(BOOL)isJoined;


/**
 *  @Author lpm, 16-10-11 10:10:47
 *
 *  @brief  根据关键字查询房间数组
 *
 *  @param key      关键字
 *  @param type     房间类型
 *
 *  @return 房间数组
 */
-(NSMutableArray *)queryRoomsByKey:(NSString *)key type:(NSInteger)type;


/**
 *  @Author lpm, 16-10-11 10:10:47
 *
 *  @brief  根据关键字查询房间数组
 *
 *  @param key      关键字
 *  @param isJoined 是否加入了房间
 *
 *  @return 房间数组
 */
-(NSMutableArray *)queryRoomsByKey:(NSString *)key isJoined:(BOOL)isJoined;


/**
 *  @Author lpm, 16-05-11 17:05:17
 *
 *  @brief  删除某种类型所有的房间
 *
 *  @param type 房间类型
 */
-(void)cleanRoomByType:(NSInteger)type;


/**
 *  @Author lpm, 16-03-03 16:03:49
 *
 *  @brief  更新群组扩展信息
 *
 *  @param room 群组
 */
-(void)updateRoomExt:(TKIMRoom *)room;


/**
 *  @Author lpm, 15-10-29 15:10:46
 *
 *  @brief  更新群组禁言时间
 *
 *  @param room 群组
 */
-(void)updateGroupGagTime:(TKIMRoom *)room;


/**
 *  @Author lpm, 16-09-20 14:09:05
 *
 *  @brief  更新群组头像
 *
 *  @param groupId  群组ID
 *  @param avatarUrl   头像
 */
-(void)updateGroupAvatarUrl:(NSString *)groupId avatarUrl:(NSString *)avatarUrl ;

@end
